package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.RubbishBinReportDao;
import cn.topevery.garden.entity.po.RubbishBinReport;
import cn.topevery.garden.entity.query.RubbishBinReportQuery;
import cn.topevery.garden.entity.vo.RubbishBinReportVO;
import cn.topevery.garden.framework.base.BaseLogic;
import com.github.dozermapper.core.Mapper;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 垃圾桶满溢信息表
 *
 * @author code-generate
 * @date 2021-08-18
 */
@Service
public class RubbishBinReportLogic extends BaseLogic<RubbishBinReport> {
    @Autowired
    RubbishBinReportDao rubbishBinReportDao;

    @Autowired
    private Mapper mapper;

    @Override
    public BaseEntityDao<RubbishBinReport, Integer> getDao() {
        return rubbishBinReportDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<RubbishBinReportVO> listPage(RubbishBinReportQuery query) {
        return rubbishBinReportDao.listPage(query);
    }


    public void saveOrUpdate(String userId, RubbishBinReport report) {
        rubbishBinReportDao.saveOrUpdate(userId, report);
    }

    /**
     * 根据自定义列值来获取对象
     */
    public RubbishBinReport getEntityByColumn(String key, String value) {
        return rubbishBinReportDao.getEntityByColumn(key, value);
    }

    public List<Map<String, Object>> rubbishBinInfo() {
        return rubbishBinReportDao.rubbishBinInfo();
    }

}
